//
//  MSActivateCardCell.m
//  觅尚
//
//  Created by No.8 on 2019/4/6.
//  Copyright © 2019 No.8. All rights reserved.
//

#import "MSActivateCardCell.h"

@implementation MSActivateCardCell

+ (instancetype)cellWithTableView:(UITableView *)tableView{
    MSActivateCardCell * cell = [tableView dequeueReusableCellWithIdentifier:[MSActivateCardCell ID]];
    cell = [[MSActivateCardCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:[MSActivateCardCell ID]];
    cell.backgroundColor = backgroundcolor;
    return cell;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setMember];
        
    }
    return self;
}
- (void)setMember{
    /** 时间*/
    self.TimeLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 40 * px, ScreenWidth / 3, 60 * px)];
    self.TimeLabel.textColor = [UIColor whiteColor];
    self.TimeLabel.text = @"2019.03.22";
    self.TimeLabel.textAlignment = NSTextAlignmentCenter;
    self.TimeLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
    [self addSubview:self.TimeLabel];
    
    
    /** 房间*/
    self.CardLabel = [[UILabel alloc] initWithFrame:CGRectMake(ScreenWidth / 3, self.TimeLabel.y, ScreenWidth / 3, self.TimeLabel.height)];
    self.CardLabel.textColor = self.TimeLabel.textColor;
    self.CardLabel.text = @"23287876";
    self.CardLabel.textAlignment = self.TimeLabel.textAlignment;
    self.CardLabel.font = self.TimeLabel.font;
    [self addSubview:self.CardLabel];
    
    
    
    
    
    /** 金额*/
    self.MoneyLabel = [[UILabel alloc] initWithFrame:CGRectMake(ScreenWidth / 3 * 2, self.TimeLabel.y, self.TimeLabel.width, self.TimeLabel.height)];
    self.MoneyLabel.textColor = WYCRGBColor(94, 205, 183);
    self.MoneyLabel.text = @"￥2000";
    self.MoneyLabel.textAlignment = self.TimeLabel.textAlignment;
    self.MoneyLabel.font = self.TimeLabel.font;
    [self addSubview:self.MoneyLabel];
    
   
    
    
    
    
    self.LinView = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.TimeLabel.frame) + 40 * px, ScreenWidth, 1)];
    self.LinView.backgroundColor = BackViewColor;
    [self addSubview:self.LinView];
    
}

- (void)setFinanciaActivateCardModel:(MSFinanciaActivateCardModel *)FinanciaActivateCardModel{
    _FinanciaActivateCardModel = FinanciaActivateCardModel;
    double time = [FinanciaActivateCardModel.createTime doubleValue] / 1000.0;
    
    NSDate *myDate = [NSDate dateWithTimeIntervalSince1970:time];
    
    NSDateFormatter *formatter = [NSDateFormatter new];
    
    [formatter setDateFormat:@"YYYY-MM-dd"];
    
    
    
    //将时间转换为字符串
    
    NSString *timeS = [formatter stringFromDate:myDate];
    
    
    WYCLog(@"---------%@",timeS);
    
    self.TimeLabel.text = [NSString stringWithFormat:@"%@",timeS];
    
    self.CardLabel.text = [NSString stringWithFormat:@"%@",FinanciaActivateCardModel.memberNumber];
    
    self.MoneyLabel.text = [NSString stringWithFormat:@"%@",FinanciaActivateCardModel.memberMoney];
    
}
+(NSString *)ID{
    return @"cell";
}


@end
